
import { Controller } from 'egg';

export default class HomeController extends Controller {
    public async index() {
        const { ctx } = this;
        ctx.body = await ctx.service.test.sayHi('egg');
    }

    // 获取相似歌单
    public async playlist() {
        const data = { songid: this.ctx.query.id };
        const url = `/weapi/discovery/simiPlaylist`;
        let result = await this.service.mequest.createWebAPIRequest(url, 'POST', data)
        const { body } = result;
        this.ctx.body = body;
    }
    // 获取相似歌手
    public async artist() {
        const data = { artistid: this.ctx.query.id };
        const url = `/weapi/discovery/simiArtist`;
        let result = await this.service.mequest.createWebAPIRequest(url, 'POST', data)
        const { body } = result;
        this.ctx.body = body;
    }

    // 获取相似MV  5571535
    public async mv(){
        const data = {mvid:this.ctx.query.id};
        const url = `/weapi/discovery/simiMV`;
        let result = await this.service.mequest.createWebAPIRequest(url, 'POST', data)
        const { body } = result;
        this.ctx.body = body;
    }

    // 相似音乐
    public async music (){
        const data = {songid:this.ctx.query.id};
        const url = `/weapi/v1/discovery/simiSong`;
        let result = await this.service.mequest.createWebAPIRequest(url, 'POST', data)
        const { body } = result;
        this.ctx.body = body;
    }

}
